import React from 'react'

import { useState } from 'react';
import styles from '../pages/typede.less';


const Header: React.FC<any> = (props:any)=>{
    let [ind,updateInd] = useState('')
    
    const findIn:any = (id:string,index:string)=>{
       console.log(id,'ijdawdjop',index)
       updateInd(index)
       props.changIn(id)
    }
  return <div className={styles.nav}>
      <div className={styles.logo}>
          <ul className={styles.ul}>
              {props.nav.map((v:any,index:any)=>{
               return <li key={v.id} 
               className={index==ind?styles.active:''} 
               onClick={()=>findIn(v.id,index)} >{v.name}</li>
              })}
          </ul>
      </div>
           
        </div>
};

export default Header;